target: lib exe

include ../../makeconf

OBJ_PATH 	= .
BIN_OUTPUT 	= $(BIN_OUTPUT_PATH)/sqlite$(BIN_EXTNAME)
LIB_OUTPUT 	= $(LIB_OUTPUT_PATH)/libsqlite$(LIB_EXTNAME)
DLL_OUTPUT 	= $(DLL_OUTPUT_PATH)/libsqlite$(DLL_EXTNAME)

VPATH 		= ./src:$(OBJ_PATH)

.SUFFIXES:
.SUFFIXES: .cpp .c .o
.c.o:
	$(GCC) -DTHREADSAFE=1 -DSQLITE_THREADSAFE=1 $(INCPATH) -c -o $(OBJ_PATH)/$@ $<
.cpp.o:
	$(CPP) -DTHREADSAFE=1 -DSQLITE_THREADSAFE=1 $(INCPATH) -c -o $(OBJ_PATH)/$@ $<

lib:sqlite3.o
	$(ARLIB) $(LIB_OUTPUT) $(OBJ_PATH)/sqlite3.o

exe:sqlite3.o shell.o
	$(GCC) -o $(BIN_OUTPUT) $(OBJ_PATH)/sqlite3.o $(OBJ_PATH)/shell.o $(PLATFORMLINK)
	
clean:
	@$(DELETEFILE) $(OBJ_PATH)/*.o

gdb:
	@$(GDB) $(BIN_OUTPUT)

run:
	@$(BIN_OUTPUT)